package javafx.com;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.scene.text.TextFlow;
import javafx.stage.Stage;

/**
 * @Classname main
 * @Date 2021/09/21 16:12
 * @Author by yx
 * @Description :
 */
public class main extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {

        Text text = new Text("javafx学习\n");
        Text text1 = new Text("javafx学习2");

        TextFlow textFlow = new TextFlow();
        textFlow.setStyle("-fx-background-color: #EE6AA7");
        textFlow.getChildren().addAll(text, text1);
        textFlow.setTextAlignment(TextAlignment.RIGHT);

        Scene scene = new Scene(textFlow);
        primaryStage.setScene(scene);
        primaryStage.setHeight(800);
        primaryStage.setWidth(800);
        primaryStage.setTitle("javafx");
        primaryStage.show();

    }
}
